﻿using System;
using System.Windows;

using Microsoft.Maps.MapControl.Core;
using Microsoft.Maps.MapControl.Navigation;

namespace SBPweb.Accelerators.StreetView.Client.BingMapsProvider.Controls
{

    public class FullScreenModeToggleCommandButton : NavigationBarCommandBase
    {

        private MapBase parent;

        public override void Execute(MapBase map)
        {
            parent = map;
        }

        public void ClickHandler(object sender, RoutedEventArgs e)
        {
            NavigationBarCommandStatus nbcs = GetStatus(parent);
            Application.Current.Host.Content.IsFullScreen = nbcs == NavigationBarCommandStatus.Normal;
        }

        public override NavigationBarCommandStatus GetStatus(MapBase map)
        {
            return Application.Current.Host.Content.IsFullScreen ? NavigationBarCommandStatus.Checked : NavigationBarCommandStatus.Normal;
        }

    }

}